package com.hdu.point_offer;

public class lcr158 {
    class Solution {
        public int inventoryManagement(int[] stock) {
            int vote = 0;
            int ans = 0;
            for (int i = 0; i < stock.length; i++) {
                if (vote == 0)
                {
                    vote++;
                    ans = stock[i];
                }
                else
                {
                    if (ans == stock[i]) vote++;
                    else vote--;
                }
            }
            return ans;
        }
    }
}
